
def count_prefixes(words:list, s:str):
    count = 0
    for word in words:
        if s.startswith(word):
            # s 是以 word开头
            count += 1
    return count


print(count_prefixes(['a', 'ab', 'abc', 'bc', 'c'], 'abc'))
print(count_prefixes(['a', 'a'], 'abc'))
